from common.login import Login
from common import setup
from selenium import webdriver
import time,os,xlrd
from utils.clickway import Toolss
from utils.generator import Faker
from common.woniubossreport import WoniuCBTReport

class mainmodole():
    # # 初始化操作，得到driver对象
    def __init__(self):
        # st = setup.Setup()
        # self.st = Login()
        self.st = Login()
        self.driver = self.st.driver

    # 登录
    def load(self,role):
        self.st.login_fast(role)

    # 模块
    def module(self,module1,module2):
        Toolss.clickbutton(self,'link_text',module1)
        time.sleep(1)
        Toolss.clickbutton(self,'link_text',module2)
        time.sleep(1)
        Toolss.Decrypt(self)
        time.sleep(1)

    # 操作
    def dosomething(self,tools,way,data,values):
        if tools == u'点击':
            Toolss.clickbutton(self,way,data)
        if tools == u'下拉框':
            Toolss.selects(self,way,data,values)
        if tools == u'输入':
            Toolss.input(self,way,data,values)
        if tools == u'键盘':
            Toolss.keybord(self,way,data,values)

    # 断言
    def doassert(self,method, data, value, r):
        Toolss.ast(self, method, data, value, r)



